#include "widget.h"
#include "ui_widget.h"

#include <QDebug>
#include <QFile>
#include <QTimer>

#include "sharelibrary.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    ShareLibrary *pShareLib = new ShareLibrary();
    qDebug() << sizeof(ShareLibrary);
    pShareLib->f();
    pShareLib->g();

    qDebug() << "*****" << endl;

    QTimer::singleShot(100, this, &Widget::slotLogOut);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::slotLogOut()
{
    // 输出信息至文件中（读写、追加形式）
    QFile file("log.txt");
    file.open(QIODevice::ReadOnly);
    QByteArray btArray = file.readAll();
    ui->textEdit->setPlainText(btArray);
    file.flush();
    file.close();
}
